package com.yunxi.service.dubboService.impl.otd;

import com.github.pagehelper.PageInfo;
import com.yunxi.core.web.ApiResult;
import com.yunxi.core.web.ResponseUtil;
import com.yunxi.otd.pojo.ProducePlanQueryVO;
import com.yunxi.otd.service.ProducePlanDubboService;
import com.yunxi.service.localService.otd.ProducePlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

public class ProducePlanDubboServiceImpl implements ProducePlanDubboService {


    @Autowired
    @Qualifier("producePlanServiceImpl")
    ProducePlanService planService;

    /**
     * 分页查询生产计划
     *
     * @param queryVO 生产计划查询VO
     * @param pageNum 页数
     * @param pageSize 每页行数
     */
    @Override
    public PageInfo pageByVo(ProducePlanQueryVO queryVO, Integer pageNum, Integer pageSize) {
        return planService.pageByVo(queryVO, pageNum, pageSize);
    }

    /**
     * 查看OTD标尺、计划、实际
     * @param planNo 生成计划号
     * @return ApiResult
     */
    @Override
    public ApiResult queryOtd(String planNo) {
        return planService.queryOtd(planNo);
    }

    /**
     * 查看OTD信息
     * @param planNo 生成计划号
     * @return ApiResult
     */
    @Override
    public ApiResult queryOtdInfo(String planNo) {
        return planService.queryOtdInfo(planNo);
    }

    /**
     * 导出
     * @param queryVO 生产计划查询VO
     * @return ApiResult
     */
    @Override
    public ApiResult export(ProducePlanQueryVO queryVO) {
        return ResponseUtil.ok(planService.listByVo(queryVO));
    }
}
